package com.vt.admin.api.feign.fallback;

import com.vt.admin.api.entity.SysLog;
import com.vt.admin.api.entity.SysLoginLog;
import com.vt.admin.api.feign.RemoteLogService;
import com.vt.common.core.util.R;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class RemoteLogServiceFallbackImpl implements RemoteLogService {
    @Setter
    private Throwable cause;

    /**
     * 保存日志
     *
     * @param sysLog
     * @return R
     */
    @Override
    public R<Boolean> saveLog(SysLog sysLog) {
        log.error("feign 插入日志失败", cause);
        return null;
    }

    /**
     * 保存登录日志
     *
     * @param sysLog
     * @return
     */
    @Override
    public R<Boolean> saveLoginLog(SysLoginLog sysLog) {
        log.error("feign 插入登录日志失败", cause);
        return null;
    }
}
